<?php
namespace app\controllers;

use app\components\Check;
use app\models\SocialworkSearchForPerson;

class ShowController extends \yii\web\Controller {
	public $layout = 'front';
	//文体活动
	public function actionLiterary() {
		if (Check::check ()) {
			$id = \Yii::$app->session->get ( 'stu' ) ['stuid'];
			return $this->render ( 'literary', [
					'id' => $id
			] );
		} else {
			return $this->redirect ( \Yii::getAlias ( '@web' ) . '/front/login' );
		}
	}
	//社会工作
	public function actionSocialwork() {
		if (Check::check ()) {
			$id = \Yii::$app->session->get ( 'stu' ) ['stuid'];
            $searchModel=new SocialworkSearchForPerson($id);
            $dataProvider=$searchModel->search(\Yii::$app->request->queryParams);
			return $this->render ( 'socialwork', [
                'dataProvider' => $dataProvider,
			] );
		} else {
			return $this->redirect ( \Yii::getAlias ( '@web' ) . '/front/login' );
		}
	}
	//奖励资助
	public function actionRewardfunding() {
		if (Check::check ()) {
			$id = \Yii::$app->session->get ( 'stu' ) ['stuid'];
			return $this->render ( 'rewardfunding', [
					'id' => $id
			] );
		} else {
			return $this->redirect ( \Yii::getAlias ( '@web' ) . '/front/login' );
		}
	}
	//荣誉称号
	public function actionHonortitle() {
		if (Check::check ()) {
			$id = \Yii::$app->session->get ( 'stu' ) ['stuid'];
			return $this->render ( 'honortitle', [
					'id' => $id
			] );
		} else {
			return $this->redirect ( \Yii::getAlias ( '@web' ) . '/front/login' );
		}
	}
	
	
}